<template>
  <el-dialog
    v-el-drag-dialog
    title="流转信息"
    :visible.sync="visible"
    width="700px"
    @closed="reset"
  >
    <div>
      <el-timeline>
        <el-timeline-item v-for="(item, index) in flowInfoData" :key="index" :timestamp="`${parseTime(item.createTime, '{y}-{m}-{d} {h}:{i}:{s}')}`" placement="top">
          <el-card>
            <p>{{ item.traceDesc }}</p>
            <div style="margin-top: 5px;"><span>发生部门---</span>{{ item.orgName }}</div>
          </el-card>
        </el-timeline-item>
      </el-timeline>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button @click="visible = false">
        关闭
      </el-button>
    </div>
  </el-dialog>
</template>

<script>
  import { recheckTrace } from '@/api'
  import { parseTime } from '@/utils'
  export default {
    name: 'transfer',
    data() {
      return {
        parseTime,
        visible: false,
        flowInfoData: []
      }
    },
    methods: {
      open(temp) {
        this.visible = true
        this.flowInfoData = []
        this.temp = temp
        this.getData()
      },
      async getData() {
        const query = {
          recheckbillCode: this.temp.recheckbillCode,
          billType: '1024'
        }
        const res = await recheckTrace(query)
        this.flowInfoData = res.data
      },
      reset() {

      }
    }
  }
</script>
<style lang="scss" scoped>

</style>
